package com.content_module.activity;

import com.content_module.R;
import com.content_module.R2;
import com.content_module.adapter.FlowTagViewAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import component.fy.com.common_module.base.BaseActivity;
import component.fy.com.common_module.view.FlowTag.FlowTagView;

public class FlowTagViewAct extends BaseActivity {
    @BindView(R2.id.content_act_flow_tag_view_tag)
    FlowTagView flowTagView;

    private FlowTagViewAdapter adapter;
    private List<String> list = new ArrayList<>();

    @Override
    protected int getLayoutId() {
        return R.layout.content_act_flow_tag_view;
    }

    @Override
    protected void initView() {
        adapter = new FlowTagViewAdapter(this, R.layout.content_item_flow_tag_view);
        flowTagView.setAdapter(adapter);
    }

    @Override
    protected void initEvents() {
        flowTagView.setItemClickListener(new FlowTagView.TagItemClickListener() {
            @Override
            public void itemClick(int position) {
                adapter.setSelectionPosition(position);
            }
        });
    }

    @Override
    protected void initData() {
        list.add("返回主App");
        list.add("BaseRecyclerAdapter不同布局展示");
        list.add("TagFlowLayout");
        list.add("FlowTagView");
        adapter.setData(list);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        clearList(list);
    }
}
